﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BSCMFF.Core.BusinessLayer
{
    /// <summary>
    /// Item for showing KPI progress.
    /// </summary>
    /// <remarks></remarks>
    public class BSCTreeListItem
    {
        /// <summary>
        /// Gets or sets the ID.
        /// </summary>
        /// <value>The ID.</value>
        /// <remarks></remarks>
        public string ID { get; set; }
        /// <summary>
        /// Gets or sets the orig ID.
        /// </summary>
        /// <value>The orig ID.</value>
        /// <remarks></remarks>
        public int OrigID { get; set; }
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        /// <remarks></remarks>
        public string Name { get; set; }
        //private enum ItemType {KPI, Perspective, BSC};
        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>The description.</value>
        /// <remarks></remarks>
        public string Description { get; set; }
        /// <summary>
        /// Gets or sets the type of the item.
        /// </summary>
        /// <value>The type of the item.</value>
        /// <remarks></remarks>
        public string ItemType { get; set; }
        /// <summary>
        /// Gets or sets the weight.
        /// </summary>
        /// <value>The weight.</value>
        /// <remarks></remarks>
        public string Weight { get; set; }
        /// <summary>
        /// Gets or sets the parent ID.
        /// </summary>
        /// <value>The parent ID.</value>
        /// <remarks></remarks>
        public string ParentID { get; set; }
        /// <summary>
        /// Gets or sets the persp.
        /// </summary>
        /// <value>The persp.</value>
        /// <remarks></remarks>
        public string Persp { get; set; }
        /// <summary>
        /// Gets or sets the progress.
        /// </summary>
        /// <value>The progress.</value>
        /// <remarks></remarks>
        public string Progress { get; set; }
        /// <summary>
        /// Gets or sets the performance.
        /// </summary>
        /// <value>The performance.</value>
        /// <remarks></remarks>
        public string Performance { get; set; }

        /// <summary>
        /// Gets or sets the current.
        /// </summary>
        /// <value>The current.</value>
        /// <remarks></remarks>
        public string Current { get; set; }
        /// <summary>
        /// Gets or sets the start.
        /// </summary>
        /// <value>The start.</value>
        /// <remarks></remarks>
        public string Start { get; set; }
        /// <summary>
        /// Gets or sets the target.
        /// </summary>
        /// <value>The target.</value>
        /// <remarks></remarks>
        public string Target { get; set; }
        /// <summary>
        /// Gets or sets the min.
        /// </summary>
        /// <value>The min.</value>
        /// <remarks></remarks>
        public string Min { get; set; }
        /// <summary>
        /// Gets or sets the max.
        /// </summary>
        /// <value>The max.</value>
        /// <remarks></remarks>
        public string Max { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:System.Object"/> class.
        /// </summary>
        /// <remarks></remarks>
        public BSCTreeListItem(){}

        /// <summary>
        /// Initializes a new instance of the <see cref="BSCTreeListItem"/> class.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="name">The name.</param>
        /// <param name="itemType">Type of the item.</param>
        /// <param name="weight">The weight.</param>
        /// <param name="parentID">The parent ID.</param>
        /// <remarks></remarks>
        public BSCTreeListItem(int id, string name, string itemType, int? weight, int parentID)
        {
            switch (itemType)
            {
                case "KPI": ID = id.ToString();
                            OrigID = id;
                            Name = name;
                            Persp = "";
                            ParentID = "perspective" + parentID.ToString();
                            Weight = weight == null ? "" : weight.ToString();
                            break;
                case "Perspective": ID = "perspective" + id.ToString();
                            OrigID = id;
                            Name = name;
                            Persp = "";
                            ParentID = "0";
                            Weight = weight == null ? "" : weight.ToString();
                            break;
                default:    ID = "0"; //BSC
                            Name = "Balance Scorecard";
                            Persp = "";
                            ParentID = "";
                            Weight = "";
                            break;
            }
            //ID = id.ToString();
            //Name = name;
            //Persp = "";
            //ParentID = ""; // parentID.ToString();
        }        
    }
      
}
